export function setToken(val){
  wx.setStorageSync('token',val)
}
export function getToken(){
  return wx.getStorageSync('token')
}
export function setUserName(val){
  wx.setStorageSync('username',val)
}
export function getUserName(){
  return wx.getStorageSync('username')
}
export function setPassword(val){
  wx.setStorageSync('password',val)
}
export function getPassword(){
  return wx.getStorageSync('password')
}
export function setNickName(val){
  wx.setStorageSync('nickname',val)
}
export function getNickName(){
  return wx.getStorageSync('nickname')
}

export function getPhone(){
  return wx.getStorageSync('phone')
}
export function setPhone(val){
  wx.setStorageSync('phone',val)
}

export function getIdCard(){
  return wx.getStorageSync('idCard')
}
export function setIdCard(val){
  wx.setStorageSync('idCard',val)
}

export function setUserInfo(val){
  wx.setStorageSync('userinfo',val)
}
export function getUserInfo(){
  return wx.getStorageSync('userinfo')
}

export function clearUserInfo(){
  wx.setStorageSync('userinfo','')
}

export function getISOWeekNumber(d) {
  d = new Date(Date.UTC(d.getFullYear(), d.getMonth(), d.getDate()));
  d.setUTCDate(d.getUTCDate() + 4 - (d.getUTCDay() || 7));
  var yearStart = new Date(Date.UTC(d.getUTCFullYear(), 0, 1));
  var weekNo = Math.ceil((((d - yearStart) / 86400000) + 1) / 7);
  return weekNo;
}

